﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XiaLastorm.Sharpshooter
{
	/// <summary>
	/// 获取好友列表结果消息
	/// </summary>
	[Serializable]
	public class RefreshFriendsListMessage : Message
	{
		/// <summary>
		/// 获取或设置好友列表
		/// </summary>
		public List<User> Friends { get; set; }

		/// <summary>
		/// 生成 <see cref="RefreshFriendsListMessage"/> class 的新实例。
		/// </summary>
		/// <param name="friends">好友列表</param>
		public RefreshFriendsListMessage(List<User> friends)
		{
			if (friends == null)
				throw new ArgumentNullException("friends");
			Friends = friends;
		}

		public override string ToString()
		{
			StringBuilder sb = new StringBuilder();
			foreach (var friend in Friends)
			{
				sb.Append(friend);
				if (friend != Friends.Last())
					sb.Append(" ");
			}
			return sb.ToString();
		}
	}
}
